<style type="text/css">
	div.tabCont{display:block !important}
	div.designWrite .editor{background:#000;color:#fff}
</style>
<script type="text/javascript">
	//<![CDATA[
	function frmValid(){
		with(document.frmReg){
			if(!template.value){
				alert("내용을 입력해주세요");
				template.focus();
				return;
			}
			submit();
		}
	}

	function themePreview(){
		window.open("/setting/designPrivew/code/<?php echo $theme['code']?>/skin/<?php echo $theme['skin']?>");
	}
	
	$(function(){
		$(".tabArea>ul>li>a").each(function(index){
			var tabImg = $(this).find("img").attr("src").replace("_on.gif",".gif");
			if($(this).find("img").attr("alt") == $("[name=skin]").val()){
				$(this).find("img").attr("src",$(this).find("img").attr("src").replace(".gif","_on.gif"));
			}else{
				$(this).find("img").attr("src",tabImg);	
			}
		});	
	});
	//]]>
</script>
<div class="box_type02">
	<h2 class="txt">사이트디자인</h2>
	<p class="icon"><a href="javascript:void(0);" class="icon_m04">매뉴얼</a></p>

	<div class="tabArea">
		<ul class="c_box">
			<li><a href="/setting/designForm/code/<?php echo $theme['code'];?>/skin/main"><img src="/theme/<?=$_theme?>/images/common/tab_design01.gif" alt="main" /></a></li>
			<li><a href="/setting/designForm/code/<?php echo $theme['code'];?>/skin/sub"><img src="/theme/<?=$_theme?>/images/common/tab_design02.gif" alt="sub" /></a></li>
			<li class="leftView"><button type="button" class="design_view" onclick="themePreview();">미리보기</button></li>
		</ul>
	</div>

	<div class="tabCont">
		<form name="frmReg" method="post" action="/setting/designModify">
		<input type="hidden" name="code" value="<?php echo $theme['code'];?>" />
		<input type="hidden" name="skin" value="<?php echo $theme['skin'];?>" />
		<!--[s] 쓰기 -->
		<fieldset class="board_write">
			<legend>사이트디자인</legend>
	
			<div class="designWrite"><textarea name="template" rows="" cols="" class="ip_t editor"><?php echo $theme['content'];?></textarea></div>
		</fieldset>
		<!--[e] 쓰기 -->
		</form>
	</div>

	<!--<div class="tabCont">
		[s] 쓰기 
		<fieldset class="board_write">
			<legend>사이트디자인</legend>

			<div class="designWrite"><textarea name="" rows="" cols="" class="ip_t">Sub 에디터가 들어갑니다.</textarea></div>
		</fieldset>
		<!--[e] 쓰기
	</div> -->

	<!-- [s] 버튼 -->
	<ul class="botton_box mt30">
		<li class="center">
			<!-- <a href="javascript:void(0);"><img src="/theme/<?=$_theme?>/images/common/btn_ok.gif" alt="확인" /></a> -->
			<a href="javascript:frmValid();"><img src="/theme/<?=$_theme?>/images/common/btn_modify.gif" alt="수정" /></a>
			<!-- <a href="javascript:void(0);"><img src="/theme/<?=$_theme?>/images/common/btn_delete.gif" alt="삭제" /></a> -->
			<a href="/setting/design"><img src="/theme/<?=$_theme?>/images/common/btn_cancel.gif" alt="취소" /></a>
		</li>
	</ul>
	<!-- [e] 버튼 -->

	<!--[s] Tip -->
	<dl id="tip" class="mt30">
		<dt>Tip</dt>
		<dd>인터넷익스플로러의 '호환성보기' 기능을 사용중인 접속자에게 자동으로 최신버전 기준으로 사이트를 출력하도록 처리합니다.</dd>
		<dd>코딩방식에 따라 특정 버전의 브라우저에서 사이트가 깨질수 있으니, 충분한 테스트 후 기능을 설정해 주시기 바랍니다.</dd>
	</dl>
	<!--[e] Tip -->
</div>